package com.senney.nio;

import java.nio.IntBuffer;

/**
 * @Author lanmengye@outlook.com
 * @Date 2020/12/28 23:06
 */
public class BasicBuffer {
    public static void main(String[] args) {
        IntBuffer intBuffer = IntBuffer.allocate(5);

        for(int i =0;i<intBuffer.capacity();i++){
            intBuffer.put(i*2);
        }

        intBuffer.flip();
        while (intBuffer.hasRemaining()){
            System.out.println(intBuffer.get());
        }
    }
}
